'''
Created on 25 feb 2010

@author: Marcus
'''
import unittest

from tv4parser import *
from utility import *


class Test(unittest.TestCase):

    def _testProgramsAO(self):
        parser = ProgramsAOParser()
        
        results = parser.parse("http://www.tv4play.se")
        
        self.failIf(len(results) == 0, "No programs found from innehall a-o")
        
    def _testCategoriesAandB(self):
        parser = CategoryParserA()
        
        results = parser.parse("http://www.tv4play.se")
        
        self.failIf(not results, "main cats found from categories")
        
        results = ContentFactory.getContents(results[1].URI)
        
        self.failIf(not results, "No programs found from categories")


    def _testCategoriesSport(self):
        parser = CategoryParserB()
        
        results = parser.parse("http://www.tv4play.se?scat=Sport")
        
        self.failIf(not results, "main cats not found from categories")
        
    def _testProgramParser(self):
        parser = ProgramParser()
        
        results = parser.parse("http://www.tv4play.se/hem_och_fritid/bygglov")
        
        self.failIf(not results, "no programs or cats found")
        
    def testTest(self):
        
        parser = VideoParser()
        parser.parse("http://www.tv4play.se/hem_och_fritid/bygglov")
    

if __name__ == "__main__":
    #import sys;sys.argv = ['', 'Test.testName']
    unittest.main()